<?php
include("RecuperarCookies.php");
?>
<!doctype html>
<html lang="es">
  <head>
    <meta charset="UTF-8">
    <title>APIISA <?= $NomPerfil ?></title>
    <link href="dist/css/bootstrap.min.css" rel="stylesheet">
      <link href="css/style.css" rel="stylesheet">
      <script src="js/jquery.js"></script>
      <script src="dist/js/bootstrap.min.js"></script>
      <script type="text/javascript">
        $(document).on("ready",function(){
          $("#input_empresa").load("CargarDatosEmpresa.php");
          $("#input_estado").load("CargarDatos.php");
          $('#input_estado').click(function(){
            $('#input_municipio').load('CargarMunicipios.php?IdEstado=' + this.options[this.selectedIndex].value);
          });
          $('#input_municipio').click(function(){
            $('#input_localidad').load('CargarLocalidades.php?IdMunicipios=' + this.options[this.selectedIndex].value);
          });
        });
      </script>
      <script type="text/javascript">
        $(function (e) {
          $('#AltEmp').submit(function (e) {
            e.preventDefault()
            $('#AjaxEmp').load('InsertaEmpresa.php?' + $('#AltEmp').serialize());
          })
        })
      </script>
  </head>
  <body>
    <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <img src="img/LOGO-APIISA.png" class="logo">
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
            <li class="active"><a href="Home.php">Inicio</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">Nuevo <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="#" data-toggle="modal" data-target=".Empresa">Empresa</a></li>
                <li><a href="#" data-toggle="modal" data-target=".DatosEmpresa">Datos Empresa</a></li>
                <li><a href="#" data-toggle="modal" data-target=".Contacto">Contacto</a></li>
                <li><a href="#" data-toggle="modal" data-target=".AltProyecto">Alta de Proyecto</a></li>
              </ul>
            </li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">Busqueda <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="#" data-toggle="modal" data-target=".c4">Buscar Empresa</a></li>
                <li><a href="#" data-toggle="modal" data-target=".c6">Buscar Datos Generales</a></li>
                <li><a href="#" data-toggle="modal" data-target=".c8">Buscar Proyecto</a></li>
              </ul>
            </li>
          </ul>
          <ul class="nav navbar-nav navbar-right">
              <li class=""><a href="#" ><?= $User ?></a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>
    <div class="container">
      <div class="jumbotron">
        <div class="row">
          <div class="col-xs-4">
            <img src="img/Directivo.png" class="img-thumbnail">
          </div>
          <div class="col-xs-4">
            <h1>Bienvenido</h1>
            <h2><?=$User?></h2>
          </div>
          <div class="col-xs-4">
            <img src="img/LOGO-APIISA.png" class="img-thumbnail">
          </div>
        </div>
      </div>
    </div>
    <div id="LoadForm">
      <div class="modal fade bs-modal-lg Contacto" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-lg">
        <div class="modal-content">
       
       <form  role="form" action="inserta_d_generales.php" class="form-tr" >
            
              <div class="form-group form-group-tr">
                <label for="inputNombre">Nombre</label>
                <input type="text" class="form-control" id="inputNombre" placeholder="Nombre" name="nombre">
              </div>
              
              <div class="form-group form-group-tr">
                <label for="inputApPat">Apellido Paterno</label>
                <input type="text" class="form-control" id="inputApPat" placeholder="Apellido Paterno" name="appat">
              </div>
              
              <div class="form-group form-group-tr">
                <label for="inputApMat">Apellido Materno</label>
                <input type="text" class="form-control" id="inputApMat" placeholder="Apellido Materno" name="apmat">
              </div>
              
              <div class="form-group form-group-tr">
                <label for="inputCargo">Cargo</label>
                <input type="text" class="form-control" id="inputCargo" placeholder="Cargo" name="cargo">
              </div>
              
              <div class="form-group form-group-tr">
                <label for="inputTelefono">Telefono</label>
                <input type="text" class="form-control" id="inputTelefono" placeholder="Telefono" name="telefono">
              </div>
              
              <div class="form-group form-group-tr">
                <label for="inputEmail">Email</label>
                <input type="text" class="form-control" id="inputEmail" placeholder="Email" name="email">
              </div>
               
                <div>
                  <input type="submit" class="btn btn-lg btn-primary" value="Enviar">
                </div>           
          </form>
      </div>
    </div>
</div>
<div class="modal fade bs-modal-lg DatosEmpresa" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-lg">
        <div class="modal-content">
      
        <form class="form-tr" role="form" action="inserta_d_emp.php" method="post" name="form1" id="form1">
          <div class="form-group form-group-tr">
          <label for="input_empresa">Empresa</label>
           <select class="form-control" name="empresa" id="input_empresa" ></select>
            </div>  
          
          <div class="form-group form-group-tr">
          <label for="input_descripcion">Descripcion</label>
          <input type="text"class="form-control"  name="descripcion"id="input_descripcion" placeholder="Descripcion">
          </div>
    
          <div class="form-group form-group-tr">
          <label for="input_giro">Giro Comercial</label>
          <input type="text"class="form-control" name="giro" id="input_giro" placeholder="Giro Comercial">
          </div>
          
          <div class="form-group form-group-tr">
          <label for="input_tel">Telefono</label>
          <input type="text"class="form-control" name="tel" id="input_tel" placeholder="Telefono">
          </div>

          <div class="form-group form-group-tr">
          <label for="input_fax">Fax</label>
          <input type="text"class="form-control" name="fax" id="input_fax" placeholder="Fax">
          </div>
          
          <div class="form-group form-group-tr">
          <label for="input_estado" >Estado</label>
          <select class="form-control" name="estado" id="input_estado" ></select>
          </div>
          
          <div class="form-group form-group-tr">
          <label for="input_municipio">Municipio</label>
          <select name="municipio"class="form-control" id="input_municipio"></select>
          </div>
    
          <div class="form-group form-group-tr">
          <label for="input_localidad">Localidad</label>
          <select name="localidad"class="form-control" id="input_localidad"></select>
          </div>
          
          <div align="center">
          <input type="submit" class="btn btn-lg btn-primary">
          </div>
  
        </form>
      </div>
      </div>
      </div>

<div class="modal fade bs-modal-lg c4" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
      
      <form role="form" action="BuscarEmpresa.php" method="post" name="form1" id="form1">
      
      <div class="form-group form-group-tr">
      <label for="input_empresa">Empresa</label>      
      <input type="text" class="form-control" name="empresa"id="input_empresa" placeholder="ID_EMPRESA">
      </div>
      
          <div align="left">
          <input type="submit" class="btn btn-lg btn-primary">
          </div>
    </form>
    </div>
  </div>
</div>

<div class="modal fade bs-modal-lg Empresa" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <form role="form" class = "form-tr "action="InsertaEmpresa.php" method="post" name="AltEmp" id="AltEmp">
      
      <div class="form-group form-group-tr">
      <label for="input_empresa">Nombre de la Empresa</label>
      <input type="text" name="nombre" class="form-control" id="input_empresa" placeholder="Inserta nombre de la empresa" required>
      </div>
        <input type="submit" class="btn btn-lg btn-primary">
         <div id="AjaxEmp"></div>
    </form>
    </div>
  </div>
</div>


<div class="modal fade bs-modal-lg c6" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        
      <form role="form" action="MostrarDatosG.php" method="post" name="form1" id="form1">
   
          <div class="form-group form-group-tr">
            <label for="input_Datos_G">IdDatos G</label>
            <input type="text" class="form-control"name="datos_g"id="input_Datos_G" placeholder="IdDatos G">
          </div>
             <div align="center">
          <input type="submit" class="btn btn-lg btn-primary">
          </div>
      </form>
    </div>
  </div>
</div>

<div class="modal fade bs-modal-lg AltProyecto" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-lg">
        <div class="modal-content">
       
       <form  role="form" class="form-tr" action="inserta_proyecto.php" method="post" name="form1" id="form1">
            
              <div class="form-group form-group-tr">
                <label for="inputDescripcion">Descripcion</label>
                <input type="text" class="form-control" id="inputDescripcion" placeholder="Descripcion" name="descripcion">
              </div>
              
              <div class="form-group form-group-tr">
                <label for="inputCliente">Cliente</label>
                <input type="text" class="form-control" id="inputCliente" placeholder="Cliente" name="cliente">
              </div>
                <div>
                  <input type="submit" class="btn btn-lg btn-primary" value="Enviar">
                </div>           
          </form>
      </div>
    </div>
</div>
  <div class="modal fade bs-modal-lg c8" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        
        <form role="form" action="MostrarProyecto.php" method="post" name="form1" id="form1">
   
          <div class="form-group form-group-tr">
            <label for="input_Proyecto">Proyecto</label>
            <input type="text" class="form-control"name="proyecto"id="input_Proyecto" placeholder="Proyecto">
          </div>
              <div align="center">
          <input type="submit" class="btn btn-lg btn-primary">
          </div>
      </form>
    </div>
  </div>
</div>


    </div>
  </body>
</html>